<template>
	<view>
		<view class="wallet-list" v-if="marthlist.length>0" v-for="(item,index) in marthlist" :key="item.id">
			<view class="top">
				<view class="title">提现</view>
				<view class="num">{{item.status==0?'待审核':item.status==1?'已完成':'已拒绝'}}</view>
			</view>
			<view class="bottom">
				<view class="mintitle">提现金额</view>
				<view class="data">{{item.money}}</view>
			</view>
			<view class="bottom">
				<view class="mintitle">手续费</view>
				<view class="data">{{item.sxf}}</view>
			</view>
			<view class="bottom">
				<view class="mintitle">实际到账</view>
				<view class="data">{{item.point}}</view>
			</view>
			<view class="bottom" v-if="item.status==2&&item.refuse_text">
				<view class="mintitle">拒绝原因</view>
				<view class="data">{{item.refuse_text}}</view>
			</view>
			<view class="bottom">
				<view class="mintitle">提现时间</view>
				<view class="data">{{$fun.formatTime(item.createtime*1000) }}</view>
			</view>
		</view>
		<noneDate v-if="marthlist.length==0">
		</noneDate>
	</view>
</template>

<script>
	import noneDate from '@/components/noneDate/noneDate.vue'
	export default {
		data() {
			return {
				marthlist: [],
				id: '',
				page: 1
			};
		},
		components: {
			noneDate
		},
		onLoad(options) {
			uni.setNavigationBarTitle({
				title: options.name
			})
			this.id = options.id
			this.init()
		},
		onReachBottom() {
			this.getList()
		},
		methods: {
			// 初始化
			init() {
				this.getList()
			},
			getList() {
				this.$fun.ajax.post('user/withdrawalList', {
					id: this.id,
					page: this.page,
					limit: 10
				}).then(res => {
					if (res.code == 1 && res.data.length > 0) {
						this.marthlist.push(...res.data)
						this.page++
					} else {
						if (this.page != 1) {
							this.$fun.msg('没有更多数据了...')
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background: #F2EDED;
	}

	.wallet-list {
		width: 700upx;
		margin: 25upx auto;
		background: #fff;
		border-radius: 10upx;
		padding: 40upx 20upx 40upx 23upx;
		box-sizing: border-box;
	}

	.wallet-list .top {
		display: flex;
		justify-content: space-between;
	}

	.wallet-list .top .title {
		color: #323232;
		font-size: 30upx;
	}

	.wallet-list .top .num {
		color: #db1121;
		font-size: 36upx;
	}

	.wallet-list .bottom {
		display: flex;
		justify-content: space-between;
		margin-top: 20upx;
		font-size: 24upx;
	}

	.wallet-list .bottom .mintitle {
		color: #808080;
	}

	.wallet-list .bottom .data {
		color: #808080;
	}
</style>